package com.iflytek.uoamp.agent.core.sender.monitorsender.requestObj;


import java.util.ArrayList;
import java.util.List;

import com.iflytek.uoamp.agent.core.sender.monitorsender.responseObj.BMonitorResponse;
import com.iflytek.uoamp.agent.core.sender.monitorsender.responseObj.Status;

public class SendResponse {
	
	public static enum RESPONSESTATUS {
		 ERROR,UPDATE,OK
	}
	
	private List<String> list = new ArrayList<String>();
	
	private RESPONSESTATUS status;

	public RESPONSESTATUS getStatus() {
		return status;
	}

	public void setStatus(RESPONSESTATUS status) {
		this.status = status;
	}
	public SendResponse(){
		
	}
	public SendResponse(BMonitorResponse obj){
		if(obj.getStatus()==Status.OK){
			if(obj.isUpdate()){
				this.status = RESPONSESTATUS.UPDATE;
			}else{
				this.status = RESPONSESTATUS.OK;
			}
		}else{
			this.status = RESPONSESTATUS.ERROR;
		}
		if(obj.getHeaders().keySet()!=null){
			list.addAll(obj.getHeaders().keySet());
		}
		
	}

	public SendResponse(Status obj){
		if(obj==Status.OK){
			this.status = RESPONSESTATUS.OK;
		}else{
			this.status = RESPONSESTATUS.ERROR;
		}
	}
	
	public List<String> getUpdateList(){
		return list;
	}
	
	public SendResponse(RESPONSESTATUS obj){
		this.status = obj;
	}
}
